<table class="layui-table text-center" lay-size="sm">
    <thead>
        <tr>
            <th><input type="checkbox" class="checked-all" target="track-id"></th>
            <th>采购单号</th>
            <th>追踪号</th>
            <th>追踪状态</th>
            <th>供应商</th>
            <th>订单状态</th>
            <th>调入仓库</th>
            <th>物流商名称</th>
            <th>是否免运费</th>
            <th>是否收货</th>
            <th>收货时间</th>
            <th>包裹重量</th>
            <th>备注</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
        {foreach $list as $item}
        <tr>
            <td><input type="checkbox" class="track-id" name="track_id[]" value="{$item.track_id}"></td>
            <td class="copy-text">{$item.purchase.purchase_sn}</td>
            <td class="copy-text text-left">{$item.track_num}</td>
            <td>{$item.track_status}</td>
            <td class="text-left">{$item.purchase.producer.name}</td>
            <td>{$item.purchase.order_status}</td>
            <td>{$item.purchase.warehouse.name}</td>
            <td>{$item.logistics_name}</td>
            <td>
                <span class="{$item.pay_type==0?'text-yellow':'text-muted'}"><i class="fa fa-circle"></i> {$item.pay_type?'否':'是'}</span>
            </td>
            <td>
                <span class="{$item.is_recv?'text-yellow':'text-muted'}"><i class="fa fa-circle"></i> {$item.is_recv?'是':'否'}</span>
            </td>
            <td>{$item.recv_date}</td>
            <td>{$item.weight?:''}{$item.weight?'克':''}</td>
            <td class="text-left">{$item.remark}</td>
            <td class="text-left">
                <a class="layui-btn layui-btn-xs layui-btn-normal ajax-form" width-form="80%" height-form="80%" href="{:url('pur/purchase/info', ['purchase_id'=>$item['purchase']['purchase_id']])}" title="采购单运输详情">查看采购单</a>
                {if !empty($item.track_info) && $item->getData('track_status') != $track_status_none}
                <a href="{:url('info',['track_id'=>$item['track_id']])}" title="物流信息" width-form="60%" height-form="60%" class="layui-btn layui-btn-xs layui-bg-green ajax-form">查看物流</a>
                {/if}
                {if empty($item.track_info) && $item->getData('track_status') == $track_status_none}
                <a href="{:url('add', ['track_id' => $item['track_id']])}" title="更新追踪号" class="layui-btn ajax-form layui-btn-xs layui-bg-green">更新追踪号</a>
                {/if}
                {if !empty($item.track_num) && $item.is_recv != 1}
                <a href="{:url('track',['ids'=>$item['track_id']])}" class="layui-btn layui-btn-xs layui-btn-warm ajax-get">拉取物流</a>
                {/if}
            </td>
        </tr>
        {/foreach}
        {empty name="list"}
        <tr>
            <td colspan="14">没有数据</td>
        </tr>
        {/empty}
    </tbody>
</table>
<div class="page">
    {$page|raw}
</div>